package util;

import java.io.IOException;
import java.util.Properties;

/**
 * @classname:PropUtil
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/28 17:02
 * @version: 0.1
 * @since:1.8
 */
public class PropUtil {
    PropUtil() {
    }

    private static Properties properties;

    static {
        properties = new Properties();
        try {
            properties.load(PropUtil.class.getClassLoader().getResourceAsStream("jdbc.properties"));
            Class.forName(PropUtil.getValue("driver"));
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static String getValue(String key) {
        return properties.getProperty(key," ");
    }
}
